<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //await 返回的是成功的值
        //失败了用try...catch捕获
        const p = new Promise((resolve, reject) => {
            reject('失败了')
        })
        async function nee() {
            try {
                let result = await p;
            } catch (e) {
                console.log(e);
            }
        }
        nee();

    </script>
</body>

</html>